export function debounce(callback:Function,time = 400){
    let timer: NodeJS.Timeout | null = null;
    return (...args:any[])=>{
        if(timer){
            clearTimeout(timer);
        }
        timer = setTimeout(()=>{
            callback(...args);
            timer = null
        },time)
    }
}